package com.guilin.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.guilin.common.annotation.Excel;
import com.guilin.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 新闻发布对象 news
 *
 * @author xiaoqi
 * @date 2025-06-18
 */
public class News extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 序号 */
    private Long id;

    /** 新闻标题 */
    @Excel(name = "新闻标题")
    private String title;

    /** 新闻简介 */
    @Excel(name = "新闻简介")
    private String summary;

    /** 新闻分类ID */
    @Excel(name = "新闻分类ID")
    private Long categoryId;

    /** 新闻内容 */
    @Excel(name = "新闻内容")
    private String content;

    /** 配图 */
    @Excel(name = "配图")
    private String imageUrl;

    /** 发布时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date publishTime;

    /** 浏览量 */
    @Excel(name = "浏览量")
    private Long viewCount;

    /** 新闻类型 */
    @Excel(name = "新闻类型")
    private String newsType;

    /** 发布人ID */
    @Excel(name = "发布人ID")
    private Long publisherId;

    /** 新闻来源 */
    @Excel(name = "新闻来源")
    private String source;

    /** 发布状态:0=草稿,1=已发布,2=已撤回 */
    @Excel(name = "发布状态:0=草稿,1=已发布,2=已撤回")
    private Long status;

    /** 撤回时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "撤回时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date withdrawTime;

    /** 最后操作人ID */
    @Excel(name = "最后操作人ID")
    private Long operatorId;

    /** 发布人账号名（非数据库字段） */
    @Excel(name = "发布人账号名")
    private String publisherName;

    /** 操作人账号名（非数据库字段） */
    @Excel(name = "最后操作人账号名")
    private String operatorName;



    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setTitle(String title)
    {
        this.title = title;
    }

    public String getTitle()
    {
        return title;
    }

    public void setSummary(String summary)
    {
        this.summary = summary;
    }

    public String getSummary()
    {
        return summary;
    }

    public void setCategoryId(Long categoryId)
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId()
    {
        return categoryId;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public String getContent()
    {
        return content;
    }

    public void setImageUrl(String imageUrl)
    {
        this.imageUrl = imageUrl;
    }

    public String getImageUrl()
    {
        return imageUrl;
    }

    public void setPublishTime(Date publishTime)
    {
        this.publishTime = publishTime;
    }

    public Date getPublishTime()
    {
        return publishTime;
    }

    public void setViewCount(Long viewCount)
    {
        this.viewCount = viewCount;
    }

    public Long getViewCount()
    {
        return viewCount;
    }

    public void setNewsType(String newsType)
    {
        this.newsType = newsType;
    }

    public String getNewsType()
    {
        return newsType;
    }

    public void setPublisherId(Long publisherId)
    {
        this.publisherId = publisherId;
    }

    public Long getPublisherId()
    {
        return publisherId;
    }

    public void setSource(String source)
    {
        this.source = source;
    }

    public String getSource()
    {
        return source;
    }

    public void setStatus(Long status)
    {
        this.status = status;
    }

    public Long getStatus()
    {
        return status;
    }

    public void setWithdrawTime(Date withdrawTime)
    {
        this.withdrawTime = withdrawTime;
    }

    public Date getWithdrawTime()
    {
        return withdrawTime;
    }

    public void setOperatorId(Long operatorId)
    {
        this.operatorId = operatorId;
    }

    public Long getOperatorId()
    {
        return operatorId;
    }

    public String getPublisherName() {
        return publisherName;
    }

    public void setPublisherName(String publisherName) {
        this.publisherName = publisherName;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("title", getTitle())
                .append("summary", getSummary())
                .append("categoryId", getCategoryId())
                .append("content", getContent())
                .append("imageUrl", getImageUrl())
                .append("publishTime", getPublishTime())
                .append("viewCount", getViewCount())
                .append("newsType", getNewsType())
                .append("publisherId", getPublisherId())
                .append("source", getSource())
                .append("status", getStatus())
                .append("withdrawTime", getWithdrawTime())
                .append("operatorId", getOperatorId())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("publisherName", getPublisherName())
                .append("operatorName", getOperatorName())
                .toString();
    }
}
